import 'package:flutter/material.dart';

import '../generated/l10n.dart';


class test_intlPage extends StatefulWidget {
  const test_intlPage({super.key});

  @override
  State<test_intlPage> createState() => _test_intlPageState();
}

class _test_intlPageState extends State<test_intlPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: const Text('test_intlPage')),
        body: Column(children: [
          Text(S
              .of(context)
              .name),
          Text(S
              .of(context)
              .age),
          ElevatedButton(onPressed: () {
            setState(() {
              S.load(Locale('en'));
            });
          }, child: Text('切换英文')),
          ElevatedButton(onPressed: () {
            setState(() {
              S.load(Locale('zh', 'CN'));
            });
          }, child: Text('切换中文'))
        ])
    );
  }
}
